package com.questionnaire.common.base;
import com.questionnaire.utils.ToString;
import lombok.Data;



/**
 * @description:
 * @author: YSL
 * @time: 2023/11/8 14:14
 */
@Data
public class R<T> extends ToString {
    private Integer code ;

    private String msg ;

    private T date;

    private String jwtToken;

    private static final long serialVersionUID = -1;

    public static <T> R<T> success(Integer code, String msg,T object,String jwtToken) {
        R<T> r = new R<T>();
        r.code = 200;
        r.msg = msg;
        r.date=object;
        r.jwtToken=jwtToken;
        return r;
    }

    public static <T> R<T> error(Integer code, String msg) {
        R r = new R();
        r.code = code;
        r.msg = msg;
        return r;
    }

}
